package com.zhuifeng.orders.controller;

import com.zhuifeng.common.core.domain.R;
import com.zhuifeng.orders.domain.Provinces;
import com.zhuifeng.orders.service.ProvincesService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/provinces")
public class ProvincesController {
    private final ProvincesService provincesService;

    public ProvincesController(ProvincesService provincesService) {
        this.provincesService = provincesService;
    }

    @GetMapping("/findByProvincesId")
    private R<List<Provinces>> findByProvincesId() {

        List<Provinces> list = provincesService.findByProvincesId();

        return R.ok(list);
    }
}
